package ute.mvc.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;

import com.fasterxml.jackson.annotation.JsonIgnore;
@Entity
public class Assignment_Student {
	@Id
	@Column (length = 20)
	private String assignment_StudentId;
	@ManyToOne
	@JoinColumn (name="assignmentId", nullable = false)
	private Assignment assignment;
	
	@ManyToOne
	@JoinColumn (name="studentId", nullable = false)
	private User student;
	
	@JsonIgnore
	@OneToOne (mappedBy = "assignment_Student")
	private SubmittedAssignment submittedAssignment;
	
	public SubmittedAssignment getSubmittedAssignment() {
		return submittedAssignment;
	}
	public void setSubmittedAssignment(SubmittedAssignment submittedAssignment) {
		this.submittedAssignment = submittedAssignment;
	}
	
	public String getAssignment_StudentId() {
		return assignment_StudentId;
	}

	public void setAssignment_StudentId(String assignment_StudentId) {
		this.assignment_StudentId = assignment_StudentId;
	}

	public Assignment getAssignment() {
		return assignment;
	}

	public void setAssignment(Assignment assignment) {
		this.assignment = assignment;
	}

	public User getStudent() {
		return student;
	}

	public void setStudent(User student) {
		this.student = student;
	}
	
}
